{% load i18n bootstrap3 dv_filters %}

<div class="panel panel-{{ organization.status_class }} vcard">
  <div class="panel-heading">
    <h2 class="panel-title"><a href="{{ organization.get_absolute_url }}" class="organization-name">{{ organization.name }}</a></h2>
  </div>
  <div class="panel-body">
    <div role="tabpane" class="tab-pane" id="address">
      <dl class="dl-horizontal">
        <dt>{% if organization.abbr %}<h4>{{ organization.abbr_verb }}</h4>{% endif %}</dt>
        <dd class="adr">
          <h4>{{ organization.name }}</h4>
          <div class="street-address">
            {{ organization.address_street }} {{ organization.address_no }}
            {% if organization.address_additional %}
              <br />{{ organization.address_additional }}
            {% endif %}
          </div>
          <div>
            <span class="postal-code">{{ organization.address_zip }}</span> <span class="locality">{{ organization.address_city }}</span>
          </div>
        </dd>
        {% if organization.website %}
          <dt>{% trans "Site web" %}</dt>
          <dd><a href="{{ organization.website }}">{{ organization.website }}</a></dd>
        {% endif %}
        {% if organization.status > 0 %}
          <dt>{% trans "État" %}</dt>
          <dd class="text-{{ organization.status_class }}">
            {{ organization.status_icon }}
            {{ organization.status_full }}
          </dd>
        {% endif %}
      </dl>
    </div>
    <div role="tabpane" class="tab-pane" id="contacts">
      <dl class="dl-horizontal">
        {% if organization.address_canton %}
          <dt>{% trans "Canton d’affiliation" %}</dt>
          <dd>{{ organization.address_canton|canton_abbr:False }}</dd>
        {% endif %}
        {% if organization.coordinator.get_full_name %}
          <dt>{% trans "Coordina·teur·trice" %}</dt>
          <dd>
            <a
                    href="{% url 'user-detail' pk=organization.coordinator.pk %}">{{ organization.coordinator.get_full_name }}</a>
          </dd>
        {% endif %}
        {% if organization.coordinator.email %}
          <dt>{% trans "Courriel" %}</dt>
          <dd><a class="email"
                 href="mailto:{{ organization.coordinator.profile.mailtolink|urlencode }}">{{ organization.coordinator.email }}</a>
          </dd>
        {% endif %}
        {% if organization.coordinator.profile.natel %}
          <dt>{% trans "Natel" %}</dt>
          <dd>{{ organization.coordinator.profile.natel|tel_link }}</dd>
        {% endif %}
        {% if organization.coordinator.profile.phone %}
          <dt>{% trans "Téléphone" %}</dt>
          <dd>{{ organization.coordinator.profile.phone|tel_link }}</dd>
        {% endif %}
      </dl>
    </div>
    {% if organization.comments %}
      <div role="tabpane" class="tab-pane panel panel-info" id="notes">
        <div class="panel-heading">{% trans "Remarques" %}</div>
        <div class="panel-body">
          {{ organization.comments }}
        </div>
      </div>
    {% endif %}
  </div>
</div>
